<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="cw" uri="/widget-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>树</title>
		<cw:base></cw:base>
		<jsp:include page="/pages/include/nocache.jsp"></jsp:include>
		<script type="text/javascript" src="${pageContext.request.contextPath}/resource/scripts/utils.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/resource/scripts/formUtils.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/resource/scripts/gridUtils.js"></script>
		<style type="text/css">
			.gridSelect-caption {
				background-color: #D0DEF0;
			}
			.biaoti{font-size:12px;}
			.required{color:red}
		</style>
	</head>
	<body>
		<cw:tab id="treeElementsTab" activeTab="0" autoScroll="false" listeners="{'tabchange':tabChg}">
			<cw:panel id="normalTreePan" contentId="normalTreeDiv" title="<span class='biaoti'>普通树</span>" autoHeight="true"/>
			<cw:panel id="editTreePan" contentId="editTreeDiv" title="<span class='biaoti'>可编辑树</span>" autoHeight="true"/>
		</cw:tab>
		
		<div id="normalTreeDiv">
			<iframe src="" id="normalTreeFrame" name="normalTreeFrame" width="100%" scrolling="no" noresize="noresize" 
				frameborder="0" onload="resetHeight(this);"></iframe>
		</div>
		
		<div id="editTreeDiv">
			<iframe src="" id="editTreeFrame" name="editTreeFrame" width="100%" scrolling="no" noresize="noresize" 
				frameborder="0" onload="resetHeight(this);"></iframe>
		</div>
		<br>
		<cw:theme></cw:theme>
	</body>
	<script type="text/javascript">
		var normalTreeFlag = true;
		var editTreeFlag = true;
		
		Ext.onReady(function(){
			window.frames["normalTreeFrame"].location = "<c:url value='/sample/component/demotree/normalTree.jsp'/>";
			normalTreeFlag = false;
		})
		
		function tabChg(tab,pan){
			var id = pan.id;
			if((id=="normalTreePan") && (normalTreeFlag==true)){
				window.frames["normalTreeFrame"].location = "<c:url value='/sample/component/demotree/normalTree.jsp'/>";
				normalTreeFlag = false;
			}else if((id=="editTreePan") && (editTreeFlag==true)){
    			window.frames["editTreeFrame"].location = "<c:url value='/sample/component/demotree/editTree.jsp'/>";
    			editTreeFlag = false;
    		}
		}
		
		function resetHeight(t){
			window.frames[t.id].resetHeight(t.id);
		}
	</script>
</html>
